using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using NUnit.Framework;
using Universe.JRun;

namespace Universe.CrossIO.Test
{
    [TestFixture]
    public class TestJDescription
    {
        [Test]
        public void TestJavaRuntimeEnvironment()
        {
            JDescriptions jre = JDescriptions.JRE;
            if (jre.Count == 0)
                Trace.WriteLine("Java Runtime Environment Not Found", "Error");

            else
            {
                Trace.WriteLine("Java Runtime Environment Current: " + jre.Current);
                foreach (JDescription description in jre)
                {
                    Trace.WriteLine("JRE " + description + " " + (description.Exists ? "Exists" : "Don't exist"));
                }
            }
        }

        [Test]
        public void TestJavaDevelopmentKit()
        {
            JDescriptions jdk = JDescriptions.JDK;
            if (jdk.Count == 0)
                Trace.WriteLine("Java Development Kit Not Found", "Error");

            Trace.WriteLine("Java Development Kit Current: " + jdk.Current);
            foreach (JDescription description in jdk)
            {
                Trace.WriteLine("JDK " + description + " " + (description.Exists ? "Exists" : "Don't exist"));
            }
        }
    }
}
